package com.yidu.t299.dao.xp;
import com.yidu.t299.domain.xp.School;
import org.apache.ibatis.annotations.*;
import java.util.List;

/*
使用Mybatis逆向生成自动生成 后续自己更改
 */

@Mapper
public interface SchoolbMapper {
    /**
     * 根据校区编号查询指定的信息
     * @param schoolId 校区编号
     * @return 校区对象
     */
    @Select({
        "select" +
        " school_id, school_name" +
        " from school" +
        " where school_id = #{schoolId,jdbcType=INTEGER}"
    })
    @Results(id = "SchoolMap",value = {
            @Result(id = true,column = "school_id",property = "schoolId"),
            @Result(column = "school_name",property = "schoolName")
    })
    School selectByPrimaryKey(Integer schoolId);

    /**
     * 查询所有校区信息
     * @return 校区名称
     */
    @Select({
            "select * from school"
    })
    @ResultMap("SchoolMap")
    List<School> selectAll();

}